Skip to content

docs(python-architect): document mermaid classDiagram :::cssClass GitHub-render trap#969

Closed
danielmeppiel wants to merge 1 commit intomainfrom
fix/python-architect-mermaid-gotcha
Closed

docs(python-architect): document mermaid classDiagram :::cssClass GitHub-render trap#969
danielmeppiel wants to merge 1 commit intomainfrom
fix/python-architect-mermaid-gotcha

Conversation

@danielmeppiel
Copy link
Copy Markdown
Collaborator

Why

While running the apm-review-panel skill on Epic #898, the Python Architect's "After" class diagram failed to render on GitHub with:

Parse error on line 50: ...*-- LockedDependency:::touched
Expecting 'NEWLINE', 'EOF', 'LABEL', got 'STYLE_SEPARATOR'

The cause: GitHub's mermaid parser only accepts the :::cssClass shorthand as a standalone class Name:::cssClass declaration in classDiagram. Appending it after a relationship arrow (A *-- B:::touched) parses fine in flowchart but not in classDiagram. The persona's existing example was already correct, but the rule was implicit -- the next reviewer (me) drifted from it and silently shipped a broken diagram.

Verdict comment that hit the trap: #898 (comment) (since patched to standalone form).

What

Adds one explicit Gotcha block under the OO / class diagram section. No code changes, no behavior changes -- this is persona-contract documentation that protects every future panel review's mermaid output.

Files

  • .apm/agents/python-architect.agent.md -- the authored source
  • .github/agents/python-architect.agent.md -- regenerated via apm install --target copilot per repo convention
  • apm.lock.yaml -- hash bump for the regenerated mirror

Test

The block reads as plain documentation; no executable contract changes. Verified by re-rendering the patched Epic #898 diagram on GitHub (now renders correctly with standalone class X:::touched declarations).

Independent of and orthogonal to PR #897 (visual-communicator persona).

…Hub-render trap

GitHub's mermaid parser rejects ':::cssClass' appended to a relationship
line ('A *-- B:::touched') with parse error 'Expecting NEWLINE, EOF,
LABEL, got STYLE_SEPARATOR'.  The shorthand is only valid as a
standalone 'class Name:::cssClass' declaration in classDiagram.  This
trap silently breaks rendered diagrams in panel review verdict comments,
which are the persona's authoritative output channel.

The persona's existing illustrative example was already correct; this
adds an explicit gotcha block so the rule cannot be missed.  Trap does
not apply to flowchart diagrams, where the inline form is valid.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 26, 2026 20:05
@danielmeppiel
Copy link
Copy Markdown
Collaborator Author

Closing -- redoing in a git worktree to avoid disturbing parallel local work. Will reopen.

@danielmeppiel danielmeppiel deleted the fix/python-architect-mermaid-gotcha branch April 26, 2026 20:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents a GitHub Mermaid parsing gotcha in the Python Architect persona contract to prevent broken classDiagram rendering when using the :::cssClass shorthand.

Changes:

  • Add an explicit gotcha note explaining that :::cssClass cannot be appended to classDiagram relationship lines on GitHub.
  • Regenerate the .github/ mirror of the agent file from .apm/.
  • Update apm.lock.yaml to reflect the new mirror file hash.
Show a summary per file
File Description
.apm/agents/python-architect.agent.md Adds a Mermaid classDiagram GitHub-render gotcha note to the authored persona contract.
.github/agents/python-architect.agent.md Regenerated mirror of the updated persona contract content.
apm.lock.yaml Updates the content hash for the regenerated .github/agents/python-architect.agent.md.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants